
use WebSecurity;
GO
-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_CATALOG = N'WebSecurity' 
	 AND SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'Membership_udt' 
)
   DROP PROCEDURE dbo.Membership_udt
GO
create procedure dbo.Membership_udt
	@MembershipID Int,
	@ConfirmationToken NVarChar(128),
	@IsConfirmed Bit,
	@LastPasswordFailureDate DateTime,
	@PasswordFailuresSinceLastSuccess Int,
	@Password NVarChar(128),
	@PasswordChangedDate DateTime,
	@PasswordSalt NVarChar(128),
	@PasswordVerificationToken NVarChar(128),
	@PasswordVerificationTokenExpirationDate DateTime,
	@TS varbinary(8),
	@CreatedBy VarChar(50),
	@CreatedDt DateTime,
	@ModifiedBy VarChar(50),
	@ModifiedDt DateTime,
	@EmailAccount NVarChar(255),
	@PasswordAnswer NVarChar(250),
	@LastLoginDate DateTime,
	@LastLockoutDate DateTime,
	@UserId Int,
	@PasswordQuestionID Int,
	@RowsAffected int = null OUTPUT 
	
--*************************************************************
--Created By: trooks
--Name: dbo_Membership_udt
--Table: Membership
--Database: WebSecurity
--Created Date: 01/21/2013 00:00:00
--*************************************************************

as
    Begin Try
		update [dbo].Membership
        Set

		ConfirmationToken = @ConfirmationToken, 
		IsConfirmed = @IsConfirmed, 
		LastPasswordFailureDate = @LastPasswordFailureDate, 
		PasswordFailuresSinceLastSuccess = @PasswordFailuresSinceLastSuccess, 
		Password = @Password, 
		PasswordChangedDate = @PasswordChangedDate, 
		PasswordSalt = @PasswordSalt, 
		PasswordVerificationToken = @PasswordVerificationToken, 
		PasswordVerificationTokenExpirationDate = @PasswordVerificationTokenExpirationDate, 
		CreatedBy = @CreatedBy, 
		CreatedDt = @CreatedDt, 
		ModifiedBy = @ModifiedBy, 
		ModifiedDt = @ModifiedDt, 
		EmailAccount = @EmailAccount, 
		PasswordAnswer = @PasswordAnswer, 
		LastLoginDate = @LastLoginDate, 
		LastLockoutDate = @LastLockoutDate, 
		UserId = @UserId, 
		PasswordQuestionID = @PasswordQuestionID 
    where
		 @MembershipID = MembershipID
		AND @TS = TS
		Set @RowsAffected = @@ROWCOUNT;
		return 0;	
	END TRY
	BEGIN CATCH
		Set @RowsAffected = 0;
		EXEC dbo.uspLogError;
		return -1;
	END CATCH
	
GO
GRANT EXECUTE ON [WebSecurity].[dbo].[Membership_udt] to PORTAL_WebSecurity
GO













